<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
    <link href="css/base.css" rel="stylesheet"/>
    <link href="css/productList.css" rel="stylesheet">
</head>
<body>
<div class="both">
    <div class="header">
        <div class="container">
            <div class="nav">
                <p>
                    <c:if test="${LoginUser==null}">
                    <a href="login.html" >登陆</a>&nbsp;&nbsp;
                    </c:if>
                    <c:if test="${LoginUser!=null}">
                    <a>${LoginUser.userName},欢迎你！</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="cart.html">我的购物车</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="login.html?out=t">注销</a>&nbsp;&nbsp;
                    </c:if>
                    |&nbsp;&nbsp;
                    <a href="register.html" >注册</a>
                </p>
                <p>|&nbsp;符合人类进步的食品</p>
                <p>
                    <a href="index.html">首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="productList.html">蛋糕名录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="user.html">用户中心</a>
                </p>
            </div>
        </div>
    </div>
    <div class="main">
        <div class="container">
            <div class="mainTitle">
                <p>
                    <a href="index.html">首页</a>>
                    <a href="">蛋糕名录</a>
                </p>
                <p>
                    品牌：<a href="#">21cake</a>
                </p>
                <p>
                        蛋糕分类：
                        <a href="?cid=0">全部</a>
                        <c:forEach var="c" items="${categories}">
                        	<a href="?cid=${c.id}">${c.name}</a>
                        </c:forEach>
                </p>
            </div>
            <div class="orderList">
                <ul>
                    排序：
                    <li><a href="#">默认</a></li>
                </ul>
                <p>
                    相关商品${total}款
                    <c:if test="${pageNum>1}">
                    <a href="?cid=${cid}&pageNum=${pageNum-1}">上一页</a>
                    </c:if>
                    <c:if test="${pageNum<=1}">
                    <a>上一页</a>
                    </c:if>
                    ${pageNum}/${totalPage}
                    <c:if test="${pageNum<totalPage}">
                    <a href="?cid=${cid}&pageNum=${pageNum+1}">下一页</a>
                    </c:if>
                    <c:if test="${pageNum>=totalPage}">
                    <a>下一页</a>
                    </c:if>
                </p>
            </div>
            <div>
                <table>
               		<c:forEach var="k" items="${cakes}">
                    <tr>
                        <td><img src="image/productImg/${k.mainimg}"></td>
                        <td>
                            <dl>
                                <dt>${k.name}</dt>
                                <dd>
                                </dd>
                            </dl>
                        </td>
                        <td>￥${k.price}/磅</td>
                        <td>
                            <a href="details.html?kid=${k.id}">商品详细</a>
                            <a href="cartadd?kid=${k.id}">加入购物车</a>
                        </td>
                    </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
    </div>
    <div class="footer">
        <hr>
        <div class="container">
            <div>
                <p>©2005-2014&nbsp;21Cake官网版权所有，并保留所有权利</p>
                <ul>
                    <li><a href="#">联系我们</a> &nbsp;</li>
                    <li><a href="#">售后流程</a> &nbsp;</li>
                    <li><a href="#">订购方式</a> &nbsp;</li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
